package ${packagePath};

import pers.cz.business.${capsTableName}Business;
import pers.cz.model.${capsTableName};
import pers.cz.pub.BeanHelper;
import pers.cz.service.${capsTableName}Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 定时任务
 * @program: PostGirl-panent
 * @description: TaskJobSercieImpl
 * @author: Cheng Zhi
 * @create: 2021-04-26 20:34
 **/
@Service
public class ${capsTableName}Business1 {

    @Autowired
    BeanHelper beanHelper;

    @Override
    public int add${capsTableName}(${capsTableName} ${lowerTableName}) {

        ${capsTableName}Business business = new ${capsTableName}Business();
        business.setMapper(beanHelper);
        return business.add${capsTableName}(${lowerTableName});

    }

    @Override
    public List<${capsTableName}> findList(${capsTableName} ${lowerTableName}) {

        ${capsTableName}Business business = new ${capsTableName}Business();
        business.setMapper(beanHelper);
        return business.findList(${lowerTableName});
    }

    @Override
    public int delete(${keyType} id) {

        ${capsTableName}Business business = new ${capsTableName}Business();
        business.setMapper(beanHelper);
        return business.delete(id);
    }

    @Override
    public int update(${capsTableName} ${lowerTableName}) {
        ${capsTableName}Business business = new ${capsTableName}Business();
        business.setMapper(beanHelper);
        return business.update(${lowerTableName});
    }

    @Override
    public ${capsTableName} findById(${keyType} id) {
        ${capsTableName}Business business = new ${capsTableName}Business();
        business.setMapper(beanHelper);
        return business.findById(id);
    }

    @Override
    public List<${capsTableName}> findAll() {

        ${capsTableName}Business business = new ${capsTableName}Business();
        business.setMapper(beanHelper);
        return business.findAll();
    }

}
